The present invention relates to the field of simulations. More particularly, the present invention relates to even-driven simulations.
Simulations are used to model physical devices to facilitate device design, prototyping, and/or testing. A computer runs simulations by executing a set of instructions or code representative of the modeled device and the functionalities of and the interactions between components comprising the modeled device. A modeled device may comprise an integrated circuit (IC), one or more components on an integrated chip (e.g., resister, transistor, processor, bus, memory, clock, etc.), the entire integrated chip, a system including one or more ICs and/or integrated chips (e.g., smartphones), and the like.
In an event-driven simulation environment, the operation of a modeled device is represented as a chronological sequence of events. Because one event may trigger the execution of another event, events can be deemed to occur at particular points on a timeline. The timeline is represented as discretely increasing time values during a simulation. A system clock defines the advancement of the time value, thereby specifying the current time value throughout the simulation. Nevertheless within a temporally decoupled simulation environment, execution of events need not be limited by the current time value. Instead, one or more events may be allowed to execute ahead of the current system clock time (e.g., simulating future events at the current time). The maximum amount of time that events can be executed ahead of the system clock time is referred to as a quantum or global quantum. While having a large global quantum increases the simulation speed, it also increases the chance of incorrect simulation results. An event executed ahead of the current system clock time may cause an event trigger to be missed or to trigger at an improper time. This can have a ripple effect throughout the rest of the simulation. Conversely, using a small global quantum increases the probability of obtaining accurate simulation results at the expense of an unduly long simulation time. The selection of the global quantum is thus not trivial.
Presently the global quantum value is set by trial and error or by taking an educated guess (using specific information about simulation components within the to-be modeled device). In cases where a too large global quantum is used, it may not even be apparent that the corresponding simulation results are incorrect due to the particular choice of global quantum. Thus, it would be beneficial to provide a mechanism to systematically determine an optimal global quantum value for a given modeled device that maximizes simulation speed without introducing simulation errors. It would also be beneficial to have feedback other than whether the simulation results are correct or not in connection with the chosen global quantum value.